.class public Lcom/instagram/creation/video/f/bb;
.super Lcom/instagram/creation/video/f/as;
.source "VideoScrubberFragmentJellybean.java"


# instance fields
.field final synthetic b:Lcom/instagram/creation/video/f/az;


# direct methods
.method public constructor <init>(Lcom/instagram/creation/video/f/az;Lcom/instagram/creation/video/gl/l;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 143
    iput-object p1, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    .line 144
    invoke-direct {p0, p1, p2}, Lcom/instagram/creation/video/f/as;-><init>(Lcom/instagram/creation/video/f/ap;Lcom/instagram/creation/video/gl/l;)V

    .line 145
    return-void
.end method


# virtual methods
.method public bridge synthetic b()V
    .locals 0

    .prologue
    .line 141
    invoke-super {p0}, Lcom/instagram/creation/video/f/as;->b()V

    return-void
.end method

.method public bridge synthetic e()V
    .locals 0

    .prologue
    .line 141
    invoke-super {p0}, Lcom/instagram/creation/video/f/as;->e()V

    return-void
.end method

.method protected h()Z
    .locals 6

    .prologue
    const/4 v5, 0x0

    const/4 v1, 0x0

    .line 148
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    new-instance v2, Landroid/media/MediaExtractor;

    invoke-direct {v2}, Landroid/media/MediaExtractor;-><init>()V

    invoke-static {v0, v2}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;Landroid/media/MediaExtractor;)Landroid/media/MediaExtractor;

    .line 150
    :try_start_0
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaExtractor;

    move-result-object v0

    iget-object v2, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    iget-object v2, v2, Lcom/instagram/creation/video/f/az;->a:Lcom/instagram/pendingmedia/model/a;

    invoke-virtual {v2}, Lcom/instagram/pendingmedia/model/a;->b()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/media/MediaExtractor;->setDataSource(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move v0, v1

    .line 156
    :goto_0
    iget-object v2, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v2}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaExtractor;

    move-result-object v2

    invoke-virtual {v2}, Landroid/media/MediaExtractor;->getTrackCount()I

    move-result v2

    if-ge v0, v2, :cond_0

    .line 157
    iget-object v2, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    iget-object v3, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v3}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaExtractor;

    move-result-object v3

    invoke-virtual {v3, v0}, Landroid/media/MediaExtractor;->getTrackFormat(I)Landroid/media/MediaFormat;

    move-result-object v3

    invoke-static {v2, v3}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;Landroid/media/MediaFormat;)Landroid/media/MediaFormat;

    .line 158
    iget-object v2, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v2}, Lcom/instagram/creation/video/f/az;->b(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaFormat;

    move-result-object v2

    const-string v3, "mime"

    invoke-virtual {v2, v3}, Landroid/media/MediaFormat;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 160
    const-string v3, "video/"

    invoke-virtual {v2, v3}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_1

    .line 161
    const-string v3, "VideoScrubberFragmentJellybean"

    const-string v4, "Video track found"

    invoke-static {v3, v4}, Lcom/facebook/e/a/a;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 162
    iget-object v3, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v3}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaExtractor;

    move-result-object v3

    invoke-virtual {v3, v0}, Landroid/media/MediaExtractor;->selectTrack(I)V

    .line 163
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v2}, Landroid/media/MediaCodec;->createDecoderByType(Ljava/lang/String;)Landroid/media/MediaCodec;

    move-result-object v2

    invoke-static {v0, v2}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;Landroid/media/MediaCodec;)Landroid/media/MediaCodec;

    .line 169
    :cond_0
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0}, Lcom/instagram/creation/video/f/az;->c(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaCodec;

    move-result-object v0

    if-nez v0, :cond_2

    .line 170
    const-string v0, "VideoScrubberFragmentJellybean"

    const-string v2, "Could not acquire decoder."

    invoke-static {v0, v2}, Lcom/facebook/e/a/a;->e(Ljava/lang/String;Ljava/lang/String;)V

    .line 171
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaExtractor;

    move-result-object v0

    invoke-virtual {v0}, Landroid/media/MediaExtractor;->release()V

    .line 172
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0, v5}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;Landroid/media/MediaExtractor;)Landroid/media/MediaExtractor;

    .line 182
    :goto_1
    return v1

    .line 151
    :catch_0
    move-exception v0

    .line 152
    const-string v2, "VideoScrubberFragmentJellybean"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Exception when preparing codec: "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v2, v0}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    .line 166
    :cond_1
    iget-object v2, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v2, v5}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;Landroid/media/MediaFormat;)Landroid/media/MediaFormat;

    .line 156
    add-int/lit8 v0, v0, 0x1

    goto/16 :goto_0

    .line 176
    :cond_2
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0}, Lcom/instagram/creation/video/f/az;->c(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaCodec;

    move-result-object v0

    iget-object v2, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v2}, Lcom/instagram/creation/video/f/az;->b(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaFormat;

    move-result-object v2

    new-instance v3, Landroid/view/Surface;

    invoke-virtual {p0}, Lcom/instagram/creation/video/f/bb;->a()Lcom/instagram/creation/video/h/e;

    move-result-object v4

    invoke-virtual {v4}, Lcom/instagram/creation/video/h/e;->d()Landroid/graphics/SurfaceTexture;

    move-result-object v4

    invoke-direct {v3, v4}, Landroid/view/Surface;-><init>(Landroid/graphics/SurfaceTexture;)V

    invoke-virtual {v0, v2, v3, v5, v1}, Landroid/media/MediaCodec;->configure(Landroid/media/MediaFormat;Landroid/view/Surface;Landroid/media/MediaCrypto;I)V

    .line 177
    invoke-virtual {p0}, Lcom/instagram/creation/video/f/bb;->a()Lcom/instagram/creation/video/h/e;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/creation/video/h/e;->d()Landroid/graphics/SurfaceTexture;

    move-result-object v0

    iget-object v1, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-virtual {v0, v1}, Landroid/graphics/SurfaceTexture;->setOnFrameAvailableListener(Landroid/graphics/SurfaceTexture$OnFrameAvailableListener;)V

    .line 180
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0}, Lcom/instagram/creation/video/f/az;->c(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaCodec;

    move-result-object v0

    invoke-virtual {v0}, Landroid/media/MediaCodec;->start()V

    .line 181
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    iget-object v1, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v1}, Lcom/instagram/creation/video/f/az;->c(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaCodec;

    move-result-object v1

    invoke-virtual {v1}, Landroid/media/MediaCodec;->getInputBuffers()[Ljava/nio/ByteBuffer;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;[Ljava/nio/ByteBuffer;)[Ljava/nio/ByteBuffer;

    .line 182
    const/4 v1, 0x1

    goto :goto_1
.end method

.method protected i()V
    .locals 4

    .prologue
    .line 187
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    iget-object v1, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    iget-object v1, v1, Lcom/instagram/creation/video/f/az;->a:Lcom/instagram/pendingmedia/model/a;

    invoke-virtual {v1}, Lcom/instagram/pendingmedia/model/a;->h()I

    move-result v1

    div-int/lit8 v1, v1, 0x2

    iget-object v2, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    iget-object v2, v2, Lcom/instagram/creation/video/f/az;->a:Lcom/instagram/pendingmedia/model/a;

    invoke-virtual {v2}, Lcom/instagram/pendingmedia/model/a;->f()I

    move-result v2

    add-int/2addr v1, v2

    mul-int/lit16 v1, v1, 0x3e8

    int-to-long v1, v1

    invoke-static {v0, v1, v2}, Lcom/instagram/creation/video/f/az;->b(Lcom/instagram/creation/video/f/az;J)J

    .line 188
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0}, Lcom/instagram/creation/video/f/az;->d(Lcom/instagram/creation/video/f/az;)J

    move-result-wide v0

    .line 190
    invoke-virtual {p0}, Lcom/instagram/creation/video/f/bb;->a()Lcom/instagram/creation/video/h/e;

    move-result-object v2

    iget-object v3, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    iget-object v3, v3, Lcom/instagram/creation/video/f/az;->a:Lcom/instagram/pendingmedia/model/a;

    invoke-virtual {v2, v3}, Lcom/instagram/creation/video/h/e;->a(Lcom/instagram/pendingmedia/model/a;)V

    .line 192
    iget-object v2, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v2}, Lcom/instagram/creation/video/f/az;->e(Lcom/instagram/creation/video/f/az;)Ljava/util/concurrent/ThreadPoolExecutor;

    move-result-object v2

    new-instance v3, Lcom/instagram/creation/video/f/bc;

    invoke-direct {v3, p0, v0, v1}, Lcom/instagram/creation/video/f/bc;-><init>(Lcom/instagram/creation/video/f/bb;J)V

    invoke-virtual {v2, v3}, Ljava/util/concurrent/ThreadPoolExecutor;->execute(Ljava/lang/Runnable;)V

    .line 198
    return-void
.end method

.method protected j()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 201
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0}, Lcom/instagram/creation/video/f/az;->c(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaCodec;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 202
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0}, Lcom/instagram/creation/video/f/az;->c(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaCodec;

    move-result-object v0

    invoke-virtual {v0}, Landroid/media/MediaCodec;->stop()V

    .line 203
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0}, Lcom/instagram/creation/video/f/az;->c(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaCodec;

    move-result-object v0

    invoke-virtual {v0}, Landroid/media/MediaCodec;->release()V

    .line 204
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0, v1}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;Landroid/media/MediaCodec;)Landroid/media/MediaCodec;

    .line 205
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0, v1}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;[Ljava/nio/ByteBuffer;)[Ljava/nio/ByteBuffer;

    .line 207
    :cond_0
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaExtractor;

    move-result-object v0

    if-eqz v0, :cond_1

    .line 208
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;)Landroid/media/MediaExtractor;

    move-result-object v0

    invoke-virtual {v0}, Landroid/media/MediaExtractor;->release()V

    .line 209
    iget-object v0, p0, Lcom/instagram/creation/video/f/bb;->b:Lcom/instagram/creation/video/f/az;

    invoke-static {v0, v1}, Lcom/instagram/creation/video/f/az;->a(Lcom/instagram/creation/video/f/az;Landroid/media/MediaExtractor;)Landroid/media/MediaExtractor;

    .line 211
    :cond_1
    return-void
.end method
